<?php
include "../AdminController/EditPlayerController.php";
if(isset($_POST['selectteam'])){
	?>
<form action='?page=EditPlayer' method='post'>
	<p>
		Select player to edit <select name='player'>
		<?php
		displayAllPlayersFromTeam($_POST['allteams']);
		?>
		</select>
	</p>
	<input type='submit' name='editplayer' value='Edit' />
</form>
		<?php
}
elseif(isset($_POST['editplayer'])){
	formToEditPlayerInfo($_POST['player']);
}
else {
	?>
<form action='?page=<?php echo $page; ?>' method='post'>
	<p>
		Select from which team would you like to edit player? <select
			name='allteams' id='allteams'>
			<?php
			displayAllRealTeamsInSelectOptions();
			?>
		</select>
	</p>
	<p>
		<input type='submit' name='selectteam' value='Select'>

</form>
			<?php
}
?>
